﻿using Microsoft.Graphics.Canvas;
using Microsoft.Graphics.Canvas.Effects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Documents;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;

// The Templated Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234235

namespace 纸片人.win2dEffectControl.DataClass
{
    public class HueToRgbEffectData : EffectOneSourceData
    {
        #region 属性
       
        private EffectHueColorSpace sourceColorSpace;

        public EffectHueColorSpace SourceColorSpace { get => sourceColorSpace; set { sourceColorSpace = value; OnPropertyChanged(); SetIsChanges(); } }
        #endregion
        public override ICanvasImage GetEffect(CanvasDevice device, bool compression)
        {
            var source = GetSourceEffect(device, compression);
            if (source == null)
                return null;

            var effect = new HueToRgbEffect()
            {
                Source = source,
                SourceColorSpace = SourceColorSpace

            };

            return effect;
        }
    }
}
